from threading import Thread
import time
def func(url):
    print('开始下载：',url)
    time.sleep(2)
    print('下载完成：',url)
if __name__ == "__main__":
    urls = ["www1","www2","www3","www4","www5"]

    starttime = time.time()
    p_list = []
    for url in urls:
        p = Thread(target=func,args=(url,))
        p_list.append(p)
        p.start()
    for p in p_list:
        p.join()
    endtime = time.time()
    print(f"耗时:{endtime-starttime}")
